package com.example.boot.modules.system.dto;

import com.example.starter.webmvc.valid.CreateValid;
import com.example.starter.webmvc.valid.UpdateValid;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 王令
 * @since 2022-08-05
 */
@Data
@Accessors(chain = true)
public class RoleDto {

    @NotNull(message = "id不能为空", groups = {UpdateValid.class})
    private Long id;

    /**
     * 角色名
     */
    @NotBlank(message = "角色名不能为空", groups = {CreateValid.class, UpdateValid.class})
    @Size(max = 32, message = "角色名不能超过32位", groups = {CreateValid.class, UpdateValid.class})
    private String name;

    /**
     * 角色编码
     */
    @NotBlank(message = "角色编码不能为空", groups = {CreateValid.class, UpdateValid.class})
    @Size(max = 32, message = "角色编码不能超过32位", groups = {CreateValid.class, UpdateValid.class})
    private String code;


}
